package com.power.flowable.model;


import com.plf.core.common.domain.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 流程环节组定义实体类
 */

@Entity
@ApiModel(value = "流程环节组定义")
@Data
@Table(name = "Act_dsn_form_scat")
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
//@IdClass(Act_dsn_form_scat.Act_dsn_form_scatPK.class) 用于复合组件
public class Act_dsn_form_scat extends BaseModel implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @Setter(AccessLevel.NONE)
    private String id;

    @ApiModelProperty(value = "表单id")
    private String formid;

    @ApiModelProperty(value = "分组名称")
    private String name;

    @ApiModelProperty(value = "是否该环节组限时办结")
    private Integer limitable;

    @ApiModelProperty(value = "日期类型")
    private Integer daytype;

    @ApiModelProperty(value = "限时天数")
    private Integer daylimit;

    @ApiModelProperty(value = "告警天数")
    private Integer daywarn;

    @ApiModelProperty(value = "背景颜色")
    private String bgcolor;

    @ApiModelProperty(value = "排序索引")
    private Integer indexsort;


    @Transient
    private List<Act_dsn_form_scat_step> list;


    public Map<String, Object> parseMap() {
        Map<String, Object> map = new HashMap<>();
        map.put("id", this.getId());
        map.put("formid", this.getFormid());
        map.put("name", this.getName());
        map.put("limitable", this.getLimitable());
        map.put("daytype", this.getDaytype());
        map.put("daylimit", this.getDaylimit());
        map.put("daywarn", this.getDaywarn());
        return map;
    }

    public String getId() {
        return id;
    }

    public void setId(Serializable id) {
        this.id = (String) id;
    }

    public Serializable getPrimaryKey() {
        return id;
        // return new Act_dsn_form_scatPK(id, id2); 用于复合主键，请手动创建内部静态类
    }

    public void setPrimaryKey(Serializable key) {
        this.id = (String) key;

        //Act_dsn_form_scatPK pk = (Act_dsn_form_scatPK) key; 用于复合主键
        //this.id = pk.getId();
        //this.id2 = pk.getId2();
    }

}